package com.liangzhong.model.buffer.vo
{
	/**
	 *加成vo 
	 * @author lake
	 * 
	 */	
	public class BufferVo
	{
		/**
		 *buffer id 
		 */		
		public var buffid 			:int;
		/**
		 *buff名称 
		 */		
		public var bname			:String;
		/**
		 *持续时间 
		 */		
		public var time				:int;
		/**
		 *每场比赛欧元获得加成，百分比 
		 */		
		public var addcoin			:int;
		/**
		 *每场比赛声望获得加成，百分比 
		 */		
		public var addfame 			:int;
		/**
		 *每场比赛球员经验获得加成，百分比 
		 */		
		public var addplayexp 		:int;
		/**
		 *每场比赛俱乐部经验获得加成，百分比 
		 */		
		public var addclubexp 		:int;
		/**
		 *增加进攻，数值 
		 */		
		public var addattack 		:int;
		/**进攻作用范围:
		1.	GK
		2.	DF
		3.	MF
		4.	FW5.	
		 全队
		 * 
		 */		
		public var ragattack 		:int;
		/**
		 *增加防守，数值 
		 */		
		public var adddefence 		:int;
		/**防守作用范围:
		 1.	GK
		 2.	DF
		 3.	MF
		 4.	FW5.	
		 全队
		 * 
		 */		
		public var ragdefence 		:int;
		/**
		 *增加抢断，数值 
		 */		
		public var addsteal 		:int;
		/**抢断作用范围:
		 1.	GK
		 2.	DF
		 3.	MF
		 4.	FW5.	
		 全队
		 * 
		 */	
		public var ragsteal			:int;
		/**
		 *增加力量，数值 
		 */		
		public var addpower 		:int;
		/**力量作用范围:
		 1.	GK
		 2.	DF
		 3.	MF
		 4.	FW5.	
		 全队
		 * 
		 */	
		public var ragpower 		:int;
		/**
		 *增加速度，数值 
		 */		
		public var addspeed 		:int;
		/**速度作用范围:
		 1.	GK
		 2.	DF
		 3.	MF
		 4.	FW5.	
		 全队
		 * 
		 */		
		public var ragspeed 		:int;
		/**
		 *增加控球，数值 
		 */		
		public var addcontrol 		:int;
		/**控球作用范围:
		 1.	GK
		 2.	DF
		 3.	MF
		 4.	FW5.	
		 全队
		 * 
		 */		
		public var ragcontrol 		:int;
		/**
		 *头像相对地址 
		 */		
		public var header  			:String;
		/**
		 *球员探索几率加成，百分比 
		 */		
		public var explore			:int;
		/**
		 *球员探索加成地区 
		 */		
		public var explorearea		:int;
		/**
		 *好感度加成，百分比 
		 */		
		public var feel				:int;
		/**
		 *好感度加成地区 
		 */		
		public var feelarea			:int;
		/**
		 *门票加成，百分比 
		 */		
		public var ticket			:int;
		/**
		 *对抗点加成，百分比 
		 */		
		public var rival			:int;
		/**
		 *国家挑战赛对方欧元消耗加成，百分比 
		 */		
		public var coin				:int;
		/**
		 *国家挑战赛对方国库削减比率，百分比 
		 */		
		public var nationcoin		:int;
		/**
		 *折扣，百分比 
		 */		
		public var rebate			:int;
		/**
		 *解析数据 
		 * @param data
		 * 
		 */		
		public function parse(data :Object):void
		{
			var xmlList:XMLList = data.children();
			for each(var xml:XML in xmlList)
			{
				if(this.hasOwnProperty(xml.localName()))
				{
					this[xml.localName()] = xml.toString();
				}
			}
		}
		/**
		 *获取buffer tip 信息 
		 * @return 
		 * 
		 */		
		public function get bufferTips():String
		{
			var info :String = "<p align='left'>";
			var colorDesc :String = "<font color='#FF6666'>";
			var posDescs :Array = ["守门员","后卫","中场","前锋","全队","国家挑战赛","国家挑战赛对手"];
			var areaDes :Array = ["亚洲","美洲","非洲","欧洲","所有"];
			if(addcoin != 0)
			{
				info += colorDesc + "每场比赛欧元" + (addcoin>0?"+":"") + addcoin + "%</font>\n";
			}
			if(addfame != 0)
			{
				info += colorDesc + "每场比赛声望" + (addfame>0?"+":"") + addfame + "%</font>\n";
			}
			if(addplayexp != 0)
			{
				info += colorDesc + "每场比赛球员经验" + (addplayexp>0?"+":"") + addplayexp + "%</font>\n";
			}
			if(addclubexp != 0)
			{
				info += colorDesc + "每场比赛俱乐部经验" + (addclubexp>0?"+":"") + addclubexp + "%</font>\n";
			}
			if(ticket != 0)
			{
				info += colorDesc;
				info += "门票加成" + (ticket>0?"+":"") + ticket + "%</font>\n";
			}
			if(rival != 0)
			{
				info += colorDesc;
				info += "对抗点加成" + (rival>0?"+":"") + rival + "%</font>\n";
			}
			if(rebate != 0)
			{
				info += colorDesc;
				info += "道具" + (rebate/10) + "折</font>\n";
			}
			if(addattack != 0)
			{
				info += colorDesc;
				if(ragattack > 0)
				{
					info += posDescs[ragattack - 1];
				}
				info += "进攻" + (addattack>0?"+":"") + addattack + "</font>\n";
			}
			if(adddefence != 0)
			{
				info += colorDesc;
				if(ragdefence > 0)
				{
					info += posDescs[ragdefence - 1];
				}
				info += "防守" + (adddefence>0?"+":"") + adddefence + "</font>\n";
			}
			if(addsteal != 0)
			{
				info += colorDesc;
				if(ragsteal > 0)
				{
					info += posDescs[ragsteal - 1];
				}
				info += "抢断" + (addsteal>0?"+":"") + addsteal + "</font>\n";
			}
			if(addpower != 0)
			{
				info += colorDesc;
				if(ragpower > 0)
				{
					info += posDescs[ragpower - 1];
				}
				info += "力量" + (addpower>0?"+":"") + addpower + "</font>\n";
			}
			if(addspeed != 0)
			{
				info += colorDesc;
				if(ragspeed > 0)
				{
					info += posDescs[ragspeed - 1];
				}
				info += "速度" + (addspeed>0?"+":"") + addspeed + "</font>\n";
			}
			if(addcontrol != 0)
			{
				info += colorDesc;
				if(ragcontrol > 0)
				{
					info += posDescs[ragcontrol - 1];
				}
				info += "控球" + (addcontrol>0?"+":"") + addcontrol + "</font>\n";
			}
			if(coin != 0)
			{
				info += colorDesc;
				info += "国家挑战赛对方欧元消耗加成" + (coin>0?"+":"") + coin + "%</font>\n";
			}
			if(nationcoin != 0)
			{
				info += colorDesc;
				info += "国家挑战赛对方国库削减比率" + (nationcoin>0?"+":"") + nationcoin + "%</font>\n";
			}
			if(explore != 0)
			{
				info += colorDesc;
				info += areaDes[explorearea-1]  + "球星探索概率增加" + explore + "%</font>\n";
			}
			if(feel != 0)
			{
				info += colorDesc;
				info += areaDes[feelarea-1]  + "球星好感度增加" + feel + "%</font>\n";
			}
			info += "</p>";
			return info;
		}
		
		
		
		/**
		 *获取国家buff（在国家挑战等级中使用）
		 * @return 
		 * 
		 */		
		public function get bufferTipsIsCountry():String
		{
			var info :String = "";
			var colorDesc :String = "";
			var posDescs :Array = ["守门员","后卫","中场","前锋","全队","国家挑战赛","国家挑战赛对手"];
			if(addcoin != 0)
			{
				info += colorDesc + "每场比赛欧元" + (addcoin>0?"+":"") + addcoin + "%，";
			}
			if(addfame != 0)
			{
				info += colorDesc + "每场比赛声望" + (addfame>0?"+":"") + addfame + "%，";
			}
			if(addplayexp != 0)
			{
				info += colorDesc + "每场比赛球员经验" + (addplayexp>0?"+":"") + addplayexp + "%，";
			}
			if(addclubexp != 0)
			{
				info += colorDesc + "每场比赛俱乐部经验" + (addclubexp>0?"+":"") + addclubexp + "%，";
			}
			if(ticket != 0)
			{
				info += colorDesc;
				info += "门票加成" + (ticket>0?"+":"") + ticket + "%，";
			}
			if(rival != 0)
			{
				info += colorDesc;
				info += "对抗点加成" + (rival>0?"+":"") + rival + "%，";
			}
			if(rebate != 0)
			{
				info += colorDesc;
				info += "折扣" + (rebate>0?"+":"") + rebate + "%，";
			}
			if(addattack != 0)
			{
				info += colorDesc;
				if(ragattack > 0)
				{
					info += posDescs[ragattack - 1];
				}
				info += "进攻" + (addattack>0?"+":"") + addattack + "，";
			}
			if(adddefence != 0)
			{
				info += colorDesc;
				if(ragdefence > 0)
				{
					info += posDescs[ragdefence - 1];
				}
				info += "防守" + (adddefence>0?"+":"") + adddefence + "，";
			}
			if(addsteal != 0)
			{
				info += colorDesc;
				if(ragsteal > 0)
				{
					info += posDescs[ragsteal - 1];
				}
				info += "抢断" + (addsteal>0?"+":"") + addsteal + "，";
			}
			if(addpower != 0)
			{
				info += colorDesc;
				if(ragpower > 0)
				{
					info += posDescs[ragpower - 1];
				}
				info += "力量" + (addpower>0?"+":"") + addpower + "，";
			}
			if(addspeed != 0)
			{
				info += colorDesc;
				if(ragspeed > 0)
				{
					info += posDescs[ragspeed - 1];
				}
				info += "速度" + (addspeed>0?"+":"") + addspeed + "，";
			}
			if(addcontrol != 0)
			{
				info += colorDesc;
				if(ragcontrol > 0)
				{
					info += posDescs[ragcontrol - 1];
				}
				info += "控球" + (addcontrol>0?"+":"") + addcontrol + "，";
			}
			if(coin != 0)
			{
				info += colorDesc;
				info += "国家挑战赛对方欧元消耗加成" + (coin>0?"+":"") + coin + "%，";
			}
			if(nationcoin != 0)
			{
				info += colorDesc;
				info += "国家挑战赛对方国库削减比率" + (nationcoin>0?"+":"") + nationcoin + "%，";
			}
			info += "";
			return info;
		}
	}
}